package com.aistar.mapper;

import com.aistar.model.entity.EmployeeBlacklist;
import com.aistar.model.entity.EmployerBlacklist;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @ClassName: EmployeeBlacklistMapper
 * @author: LiuWenXiu
 * @date: 2021/10/3 22:51
 * @Description: TODO...
 */
public interface EmployeeBlacklistMapper {

    // 根据公司id获取求职者id
    @Select("select * from employee_blacklist where company_id = #{id}")
    List<EmployeeBlacklist> findEmployeeIdByCompanyId(Integer id);

    //新增全部黑名单
    @Insert("insert into employee_blacklist values(#{id},#{employeeId},#{companyId})")
    int addBlackList(EmployeeBlacklist employeeBlacklist);

    //根据求职者id获取公司id
    @Select("select company_id from employee_blacklist where employee_id=#{id}")
    List<Integer> findByRecruitmentId(Integer id);

    //根据求职者id和公司id确定数据
    @Select("select count(*) from employee_blacklist where employee_id=#{eid} and company_id=#{cid}")
    int findInfo(Integer eid, Integer cid);

    //根据id删除信息
    @Delete("delete from employee_blacklist where employee_id=#{eid} and company_id=#{cid}")
    int DelBlack(Integer eid, Integer cid);

    @Select("select * from employee_blacklist where employee_id = #{employeeId}")
    List<EmployeeBlacklist> findByEmployeeId(Integer employeeId);
}
